package dht.message;

import java.io.Serializable;
import java.net.InetAddress;

import dht.data.DhtData;
import dht.data.TabBigInteger;

public class PutMessage extends Message implements Serializable {

	private static final long serialVersionUID = 8924516716985710904L;
	private DhtData<Integer> dhtData;
	
	public PutMessage(InetAddress adresseIpClient, String virtualId,
			          TabBigInteger destination, DhtData<Integer> dhtdata) {
		
		super(adresseIpClient, virtualId, destination);
		
		this.dhtData = dhtdata;
		this.TYPE_MSG=PUT_Message;
	}
	
	public PutMessage PutReply(InetAddress adresseIpClient, String virtualId,
	          TabBigInteger destination, DhtData<Integer> dhtdata, InetAddress origine) {

		PutMessage p = new PutMessage(adresseIpClient, virtualId, destination,dhtdata);

		p.TYPE_MSG=REPLY_Message;
		return p;
	}

	public DhtData<Integer> getDhtData() {
		return dhtData;
	}
}
